<template>
<view>
	<cu-custom bgColor="bg-gradual-blue" :isBack="true">
		<block slot="backText">返回</block>
		<block slot="content">{{ title }}</block>
	</cu-custom>		
	<view class="about">		
		<view class="logo">
			<image :src="LOGO"></image>
		</view>
		<view class="item-list">
			<view class="item">
				<view>当前版本</view>
				<view>
					<!-- #ifdef APP-PLUS -->
					{{ version }}
					<!-- #endif -->
				</view>
			</view>
			<view class="item">
				<view>新版更新</view>
				<view>无新版</view>
			</view>
		</view>
		<view class="item-list mine">
			<view class="item" @tap="clearStore">
				<view>清除缓存</view>
			</view>			
			<navigator hover-class="none" url="/usercenter/about_shop" class="item">
				<view>关于我们</view>
			</navigator>
		</view>
		<view class="copyright">
			<view class="name">{{ info.name }}</view>
			<view class="time">{{ info.time }}</view>
		</view>
	</view>
</view>
</template>

<script>
	import { About } from '@/common/api/users'
	import { APP_NAME } from '@/common/utils/config'
	import { mapActions, mapGetters } from 'vuex'
	export default {
		name: 'about',
		data () {
			return {
				// #ifdef APP-PLUS
				version: plus.runtime.version,
				// #endif				
				info: {},
				logo: [
					{ id: 1192, src: '/static/weijiugui.png' },
					{ id: 1229, src: '/static/dailai.png' }
				]
			}
		},
		computed: {
			...mapGetters(['navigator', 'shop']),
			title () {
				return this.navigator.title
			},
			LOGO () {
				return this.logo.filter(item => item.id === this.shop.customer_id)[0].src
			}
		},
		created () {
			this.getInfo()
			// #ifdef APP-PLUS
			// #endif
		},
		methods: {
			...mapActions([
				'GetAppid'
			]),
			clickMe () {
				
			},
			getInfo() {
				uni.showLoading({
					mask: true
				})
				About().then(res => {
					uni.hideLoading()
					if (!res.code) {
						this.info = res.data
						this.$store.commit('SET_SHOP_DESC', res.data.jieshao)
					}
				})
			},
			clearStore () {
				uni.clearStorageSync()
				this.GetAppid(this.$appid).then(() => {
					uni.showModal({
						content: '清除成功',
						showCancel: false
					})
				})
			}
		}
	}
</script>

<style lang="less" scoped>
@import '../common/styles/variables.less';	
.about {
	.logo {
		padding: 50upx 0;
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		//background: @headBg;
		image {
			width: 260upx;
			height: 260upx;
			border-radius: 20upx;
		}
	}
	.item-list {
		.item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			background-color: white;
			height: @height;
			padding: 0 15upx;
			&:not(:last-of-type) {
				.border-bottom(15upx);
			}
			& > view {
				font-size: @medium;
				&:nth-of-type(2) {
					color: @gray;
				}
			}
		}
		&.mine {
			margin-top: 15upx;
			.item {
				&:first-child {
					.border-bottom(15upx);
				}
				&:last-child {
					.arrowRight(#666, 0, 15upx)
				}
			}
		}
	}
	.copyright {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		flex-flow: column;
		padding-top: 50upx;
		& > view {
			font-size:@minSize;
			color: @gray;
		}
	}
}
</style>
